<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            background-color: #000;
        }

        div {
            display: block;
            width: 50px;
            margin: auto;
            margin-top: 300px;
            font-size: 100px;
        }

        div span {
            opacity: 0.3;
        }
    </style>
</head>

<body>
    <button>开灯</button>
    <div> <span>💡</span> </div>
</body>
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
<script>
    $(function () {
        $('button').click(function () {
            if ($(this).text() == "关灯") {
                $('body').css('background-color', '#000');
                $('span').css('opacity', '')
                $(this).text("开灯");
            } else {
                $('body').css('background-color', '#fff');
                $('span').css({
                    'opacity': '1',
                })
                $(this).text('关灯');
            }
        })
    })
</script>

</html>